//用户相关的接口函数放在这里
import request from "@/utils/request"
// 枚举定义接口地址
enum API {
   UPADTE = "/users", //更新用户信息
   CHANGEPASS = '/users/change', //修改账号密码
   USERS = '/users',//查询所有用户信息
   DELETEUSERS = '/users/',//删除用户
   ADDUSERS = '/users',//注册用户
   EXTIST="/users/extist/",//检测是否存在指定账号名称
}

//更新用户信息
export const reqUpdate = (data: any) => request.put<any, any>(API.UPADTE, data)
//修改账号密码
export const reqChangepass = (data: any) => request.post<any, any>(API.CHANGEPASS, data)
//查询所有用户信息
export const reqUsers = () => request.get<any, any>(API.USERS)
//删除用户
export const reqDeleteUsers = (accountName: any) => request.delete<any, any>(API.DELETEUSERS + `${accountName}`)
//注册用户
export const reqAddUsers = (data: any) => request.post<any, any>(API.ADDUSERS, data)
//检测是否存在指定账号名称
export const reqExtist = (accountName: any) => request.post<any, any>(API.EXTIST+ `${accountName}`)